// import request from '@/http/httpload.js'
import http from '@/config/http' //导入http下的httpload.js
import qs from 'qs'

import {
	encryption
} from '@/utils/common.js'

export const loginByUsername = (params, data) => {
	const user = encryption({
		data: data,
		key: 'pigxpigxpigxpigx',
		param: ['password']
	})
	return http.middleware({
		method: 'POST', // 必须大写
		url: '/shopapp/auth/oauth/token',
		data: {
			username: user.username,
			password: user.password
		},
		params: params
	})
}
